{extend name='admin@main'}

{block name="button"}

{if auth("add")}
<button data-modal='{:url("add")}' data-title="添加主体" class='layui-btn layui-btn-sm layui-btn-primary'>添加主体</button>
{/if}
{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些主体吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除主体</button>
{/if}
<!-- <button data-modal='{:url("send")}' data-title="添加主体" class='layui-btn layui-btn-sm layui-btn-primary'>发送邮箱测试</button> -->
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='body/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-center nowrap'>属性</th>
            <th class='text-center nowrap'>主体名称</th>
            <th class='text-center nowrap'>负责人姓名</th>
            <th class='text-left nowrap'>身份证号</th>
            <th class='text-left nowrap'>手机号</th>
            <th class='text-left nowrap'>收款信息</th>
            <th class='text-left nowrap'>身份证照片</th>
            <th class='text-left nowrap'>营业执照</th>
            <th class='text-left nowrap'>签署日期</th>
            <th class='text-left nowrap'>合同</th>
            <th class='text-center nowrap'>状态</th>
            <th class='text-left nowrap'>添加时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            
            <td class='text-center nowrap'>
                {eq name='vo.att' value='0'}<span class="layui-badge layui-bg-blue">车队</span>{/eq}
                {eq name='vo.att' value='2'}<span class="layui-badge layui-bg-green">劳务</span>{/eq}
            </td>
            <td class='text-center nowrap'>{$vo.body_name|default=''}</td>
            <td class='text-center nowrap'>{$vo.name|default='-'}</td>
            <td class='text-left nowrap'>{$vo.ID_number|default='-'}</td>
            <td class='text-left nowrap'>{$vo.phone|default='-'}</td>
            <td class='text-left nowrap'>{$vo.pay_info|default='-'}</td>
            <td class='text-left nowrap'>
                <a data-tips-image="{$vo.ID_image|default=''}" class="fa fa-image font-s14 margin-right-5"></a>
            </td>
            <td class='text-left nowrap'>
                <a data-tips-image="{$vo.business_image|default=''}" class="fa fa-image font-s14 margin-right-5"></a>
            </td>
            <td class='text-left nowrap'>{$vo.sign_time|default='-'}</td>
            <td class='text-left nowrap'>
                <a href="{$vo.contract|default='-'}">点击下载</a>
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{/eq}
                {eq name='vo.status' value='1'}<span class="color-green">正常</span>{/eq}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at|format_datetime}
            </td>
            <td class='text-left nowrap'>

                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑作业主体信息" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if auth("state") and $vo.status neq 0}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">禁 用</a>
                {elseif auth("state") and $vo.status neq 1 }
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">启 用</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该主体吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
